from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import ExperimentStatisticsViewSet, ExperimentAttachmentViewSet

# 创建路由器
router = DefaultRouter()
router.register(r'experiments', ExperimentStatisticsViewSet, basename='experiment-statistics')
router.register(r'attachments', ExperimentAttachmentViewSet, basename='experiment-attachments')

urlpatterns = [
    path('', include(router.urls)),
]

# 生成的URL路径:
# GET /api/experiment-statistics/experiments/ - 获取试验列表
# POST /api/experiment-statistics/experiments/ - 创建新试验
# GET /api/experiment-statistics/experiments/{id}/ - 获取单个试验详情
# PUT /api/experiment-statistics/experiments/{id}/ - 更新试验
# PATCH /api/experiment-statistics/experiments/{id}/ - 部分更新试验
# DELETE /api/experiment-statistics/experiments/{id}/ - 删除试验
# GET /api/experiment-statistics/experiments/statistics/ - 获取统计信息
# GET /api/experiment-statistics/experiments/categories/ - 获取分类列表
# POST /api/experiment-statistics/experiments/{id}/add_attachment/ - 添加附件
# GET /api/experiment-statistics/experiments/{id}/attachments/ - 获取试验附件
# GET /api/experiment-statistics/attachments/ - 获取附件列表
# POST /api/experiment-statistics/attachments/ - 创建附件
# GET /api/experiment-statistics/attachments/{id}/ - 获取单个附件
# PUT /api/experiment-statistics/attachments/{id}/ - 更新附件
# DELETE /api/experiment-statistics/attachments/{id}/ - 删除附件